import { BasicColumn, FormSchema } from '/@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '租户ID',
    dataIndex: 'tenantId',
  },
  {
    title: '商品编码',
    dataIndex: 'skuSn',
  },
  {
    title: 'SPU ID',
    dataIndex: 'spuId',
  },
  {
    title: '商品名称',
    dataIndex: 'name',
  },
  {
    title: '商品规格值，以英文逗号(,)分割',
    dataIndex: 'specIds',
  },
  {
    title: '商品价格(单位：分)',
    dataIndex: 'price',
  },
  {
    title: '库存数量',
    dataIndex: 'stockNum',
  },
  {
    title: '锁定库存数量',
    dataIndex: 'lockedStockNum',
  },
  {
    title: '商品图片地址',
    dataIndex: 'picUrl',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'tenantId',
    label: '租户ID',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'skuSn',
    label: '商品编码',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'spuId',
    label: 'SPU ID',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'name',
    label: '商品名称',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'specIds',
    label: '商品规格值，以英文逗号(,)分割',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'price',
    label: '商品价格(单位：分)',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'stockNum',
    label: '库存数量',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'lockedStockNum',
    label: '锁定库存数量',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'picUrl',
    label: '商品图片地址',
    component: 'Input',
    colProps: { span: 6 },
  },
];

export const formSchema: FormSchema[] = [
  {
    field: 'id',
    label: 'ID',
    component: 'Input',
    show: false,
  },
  {
    field: 'tenantId',
    label: '租户ID',
    component: 'Input',
    required: true,
  },
  {
    field: 'skuSn',
    label: '商品编码',
    component: 'Input',
    required: true,
  },
  {
    field: 'spuId',
    label: 'SPU ID',
    component: 'Input',
    required: true,
  },
  {
    field: 'name',
    label: '商品名称',
    component: 'Input',
    required: true,
  },
  {
    field: 'specIds',
    label: '商品规格值，以英文逗号(,)分割',
    component: 'Input',
    required: true,
  },
  {
    field: 'price',
    label: '商品价格(单位：分)',
    component: 'Input',
    required: true,
  },
  {
    field: 'stockNum',
    label: '库存数量',
    component: 'Input',
    required: true,
  },
  {
    field: 'lockedStockNum',
    label: '锁定库存数量',
    component: 'Input',
    required: true,
  },
  {
    field: 'picUrl',
    label: '商品图片地址',
    component: 'Input',
    required: true,
  },
];
